Text Ranges
We can use TextRanges move methods to replace selected text.